package com.example.auth.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.auth.entity.SysUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.auth.entity.SysUserRole;
import com.example.auth.entity.dto.SysUserQueryDTO;
import com.example.auth.entity.vo.SysUserQueryVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author SIE
* @description 针对表【sys_user(用户表)】的数据库操作Mapper
* @createDate 2023-07-07 13:05:31
* @Entity com.example.auth.entity.SysUser
*/
@Mapper
public interface SysUserMapper extends BaseMapper<SysUser> {

    Page<SysUserQueryVO> selectUserPage(Page<SysUserQueryVO> sysUserPage, @Param("sysUserQueryDTO") SysUserQueryDTO sysUserQueryDTO);

    List<SysUserRole> getRolesByUserId(@Param("userId") Long userId);

    void doAssign(@Param("userId") Long userId, List<Long> userRoleIds);

    void deleteUserRoleByUserId(@Param("userId") Long userId);

    void deleteBatchUserRoleByUserId( List<Long> userIdList);

    void updateUserStatus(@Param("userId") Long userId, @Param("status") Long status);

    void batchInsert(List<SysUser> sysUserList);
}




